<template>
  <div class="s-dsfimg">
    <img :src="src" @error="headError" />
  </div>
</template>
<script setup>
import { toRef } from "vue";
let props = defineProps({
  src: {
    type: String,
  },
  errorSrc: {
    type: String,
    default: "/src/assets/imgs/pc/default/404.png",
  },
});
const errimg = toRef(props, "errorSrc"); //变成响应式的数据
const headError = e => {
  e.target.src = errimg.value;
};
</script>
